<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ include file="/includes/taglibs.jsp" %>
<html>
<head>
<title>用户编辑</title>
<%@ include file="/includes/meta.jsp" %>
</head>
<body>
<form name="userForm" action="${ctx}/admin/user/saveOrUpdateUser" method="post">
<input type="hidden" name="id" value="<c:out value="${user.id}" default="0"/>"/>
<input type="hidden" name="ipAddress" value="${(not empty user.ipAddress)?user.ipAddress:pageContext.request.remoteAddr}"/>
<spring:eval expression="new java.util.Date()" var="today"/>
<input type="hidden" name="regDate" value="<fmt:formatDate value="${(not empty user.regDate)?user.regDate:today}" pattern="yyyy-MM-dd"/>" />
<table>
	<tr>
		<td colspan="4">编辑用户</td>
	</tr>
	<tr>
		<td>用户名：</td>
		<td><input type="text" name="username" value="${user.username}"/></td>
		<td>显示名：</td>
		<td><input type="text" name="realName" value="${user.realName}"/></td>
	</tr>
	<tr>
		<td>密码：</td>
		<td><input type="text" name="password" value="${user.password}"/></td>
		<td>用户状态：</td>
		<td>
			<select name="state">
				<c:forEach items="${userStateValues}" var="stateLabel">
					<option value="${stateLabel.value}" <c:if test="${stateLabel.value == user.state}">selected</c:if>>${stateLabel.label}</option>
				</c:forEach>
			</select>
		</td>
	</tr>
	<tr>
		<td colspan="4">
			<input type="button" value="提交" onclick="userForm.submit();"/>
			<input type="button" value="返回" onclick="history.back(-1);"/>
		</td>
	</tr>
</table>
</form>
</body> 
</html>  